import { mergeConfig } from 'vite';
import eslint from 'vite-plugin-eslint';
import stylelint from 'vite-plugin-stylelint';
import VueDevTools from 'vite-plugin-vue-devtools';

import baseConfig from './vite.config.base';

export default mergeConfig(
    {
        mode: 'development',
        server: {
            fs: {
                strict: true,
            },
            hot: true,
            host: '0.0.0.0',
            port: 5173,
            proxy: {
                '/resources/V1.0/': {
                    /*
                     * target: 'http://192.169.7.225:9999',
                     * target: 'http://192.169.7.234:9999',
                     */
                    // target: 'http://192.169.7.230:9999',
                    target: 'http://10.113.53.95:9999',


                    changeOrigin: true,
                },
            },
        },
        plugins: [
            eslint({
                lintOnStart: false,
                include: ['**/*.{js,jsx,vue}'],
            }),
            stylelint({
                lintOnStart: false,
                lintInWorker: true,
                cache: true,
                cacheLocation: 'node_modules/.cache/.stylelintcache',
                include: ['**/*.{html,vue,less}'],
            }),
            VueDevTools(),
        ],
    },
    baseConfig,
);
